package org.quipu.domain;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "CURRENCY_DIC")
public class CurrencyDic extends UniqueEntity implements Serializable {

    @Column(name = "TITLE", length = 32, nullable = false, unique = true)
    private String title;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public String toString() {
        return "{ id=" + getId() + "; title=" + getTitle() + "; }";
    }

    @Override
    public boolean equals(Object cur) {
        if(cur == null) {
            return false;
        } else {
            return cur instanceof CurrencyDic && getId().equals(((CurrencyDic)cur).getId());
        }
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (getId() != null ? getId().hashCode() : 0);
        return hash;
    }
}
